﻿<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeBehind="msg_receive_view.aspx.cs" Inherits="Ccit.SysPlat.Remind.msg_receive_view" %>

<%@ Register TagPrefix="ccit" Namespace="Ccit.ServerControls" Assembly="Ccit.ServerControls.ActionForm" %>

<%@ Register TagPrefix="ccit" TagName="attach" Src="../UserControls/AttachUpLoad.ascx" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>在线消息-消息查看</title>
    
    <script type="text/javascript" language="javascript">
      //转发
      function doForword()
      {
         var vPageSource = document.getElementById("_hidPageSource").value;
         
         var vMsgId = document.getElementById("_hidMsgId").value;
         var vPageParam = "MsgId="+vMsgId+"&PageSource=3&curCount="+document.getElementById("_hidCurCount").value+"&senderId="+document.getElementById("_hidSenderId").value;
        
         if(vPageSource == "1") //接收
         {
            vPageParam += "&Flag=1";   
         }
         if(vPageSource == "2") //发送
         {
            vPageParam += "&Flag=2";   
         }
         var encodeParam = base64encode(vPageParam);
         document.location = "msg_send_edit.aspx?" + encodeParam;
      }
      
      //重发
      function doReSend()
      {
         var vMsgId = document.getElementById("_hidMsgId").value;
         PageMethods.OperMsg(vMsgId,ClientCallBack);
      }
      function ClientCallBack(vResult)
      {
          if(vResult > 0 )
          {
             alert("发送成功");
             window.opener.__doPostBack("lnkSearch","");
             window.close();
          }
          else
          {
             alert("系统忙,请稍候再试");     
          }
      }
      
      //关闭
      function doCancle(pagefrom)
      {
         var vPageSource = document.getElementById("_hidPageSource").value;
         if(vPageSource == "1") //接收消息
         {
              window.opener.__doPostBack("lnkSearch","");
              window.close();
         }
         if(vPageSource == "2")  //发送消息
         {
             window.close();
         }
         if(pagefrom == "3") //首页
         {
            var callMethod = document.getElementById("_hidcallMethod").value;
            var callArr = callMethod.split(",");
            eval("opener.window." + callArr[0] + "('"+callArr[1]+"','"+callArr[2]+"')");
            window.close();
         }
      }
      //回复
      function doReply()
      {
         var vPageSource = document.getElementById("_hidPageSource").value;
         if(vPageSource == "1") //接收消息
         {
            var vMsgId = document.getElementById("_hidMsgId").value;
            var vSenderId = document.getElementById("_hidSenderId").value;
            var vPageParam ="MsgId="+vMsgId+"&RecevierId="+vSenderId+"&PageSource=3&curCount="+document.getElementById("_hidCurCount").value+"&Flag=1";
            var encodeParam = base64encode(vPageParam);
            document.location = "msg_receive_back.aspx?" + encodeParam;
         }
      }
    </script>
    
</head>
<body>
    <ccit:ActionForm id="form1" runat="server">
    
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
    </asp:ScriptManager>
    
    <input type="hidden" id="_hidMsgId" runat="server" />
    <input type="hidden" id="_hidSenderId" runat="server" />
    <input type="hidden" id="_hidCurCount" runat="server" />
    
    <input type="hidden" id="_hidPageSource" runat="server" />
    <input type="hidden" id="_hidcallMethod" runat="server" />
    <input type="hidden" id="_hidMaxCount" runat="server" value="0" />
    
    <table cellpadding="0" cellspacing="0" class="tbToolbar" width="98%" align="center">
      <tr>
        <td align="left">
          <div class="tbSeparator"></div>
        </td>
        <td width="100%" class="titlebar">在线消息-消息查看</td>
        <td align="right">
          <div class="tbSeparator"></div>
        </td>
        <td id="tdClose" runat="server" style="display:none">
         <nobr>
          <a href="javascript:doCancle('3');" class="linktext"><img alt="" src="../images/toolbar/close.gif" />关闭</a>
          </nobr>
        </td>
      </tr>
    </table>
    
    <table cellpadding="0" cellspacing="0" align="center" width="98%"  height="5px" style="margin-top:3px">
     <tr>
       <td>
          <fieldset style="width:100%">
             <table cellpadding="0" cellspacing="0" width="100%" align="right" height="3px" >
              <tr>
                <td align="right" style="width:50%"  >
                 <nobr>
                  共<font color="red"><asp:Label ID="lblMsgCount" runat="server" Text="0"></asp:Label></font>条接收消息&nbsp;
                 </nobr> 
                </td>
                <td align="right"  style="width:10%" >
                  <nobr> 
                     <asp:LinkButton ID="lnkFirst" runat="server"  class="linktext" 
                        onclick="lnkFirst_Click">第一条</asp:LinkButton>&nbsp;
                  </nobr>
                </td>
                <td align="right"  style="width:10%">
                  <nobr> 
                    <asp:LinkButton ID="lnkUp" runat="server" class="linktext" 
                        onclick="lnkUp_Click">上一条</asp:LinkButton>&nbsp;
                  </nobr>
                </td>
                <td align="right"  style="width:10%" >
                   <nobr> 
                     第【<font color="red"><asp:Label ID="lblCurCount" runat="server" Text="0"></asp:Label></font>】条&nbsp;
                  </nobr>
                </td>
                <td align="right" style="width:10%" >
                  <nobr>
                     <asp:LinkButton ID="lnkDown" runat="server" class="linktext"
                        onclick="lnkDown_Click" >下一条</asp:LinkButton>&nbsp
                  </nobr>
                </td>
                <td align="right" style="width:10%" >
                  <nobr> 
                     <asp:LinkButton ID="lnkLast" runat="server"  class="linktext" 
                        onclick="lnkLast_Click">最后一条</asp:LinkButton>&nbsp;
                  </nobr>
                </td>
              </tr>
             </table>
          </fieldset>
       </td>
     </tr>
    </table>
    
    <table class="tableborder" cellpadding="0" cellspacing="0" width="98%" align="center" runat="server" id="tab1">
      <tr>
        <td width="7%" valign="top" align="left" class="pformleft"><nobr>内容</nobr></td>
        <td class="pformright" colspan="3" >
          <textarea id="txtareaContent" rows="9" class="inputarea" runat="server" cols="30" style="width:100%;"></textarea>
        </td>
      </tr>
      <tr>
        <td width="7%" align="left" class="pformleft"><nobr>附件</nobr></td>
        <td class="pformright" colspan="3" >
           <ccit:attach id="ucAttach" ShowStyle="1" runat="server"></ccit:attach>
        </td>
      </tr>
      
      <!-- 接收人页面2 -->      
      <tr id="trSender" runat="server" class="pformleft">
        <td width="7%" valign="top" align="left" class="pformleft"><nobr>发送人</nobr></td>
        <td class="pformright">
           <asp:Label ID="lblSender" runat="server" Text="0"></asp:Label>
        </td>
        <td width="10%" valign="top" align="left" class="pformleft"><nobr>发送时间</nobr></td>
        <td class="pformleft">
          <asp:Label ID="lblSendTime" runat="server" Text=""></asp:Label>
        </td>
      </tr>
      <tr id="trReceiverTime" runat="server">
        <td width="8%" valign="top" align="left" class="pformleft"><nobr>接收时间</nobr></td>
        <td class="pformright" colspan="3" >
          <asp:Label ID="lblReceiveTime" runat="server" Text="0"></asp:Label>
        </td>
      </tr>
      <!-- 发送人页面`1 -->
      <tr id="trSendTime" runat="server">
        <td width="8%" valign="top" align="left" class="pformleft"><nobr>发送时间</nobr></td>
        <td class="pformright" colspan="3" >
            <asp:Label ID="lblSendTime1" runat="server" Text=""></asp:Label>
        </td>
      </tr>
      <tr id="trReceiver" runat="server">
        <td width="8%" align="left" class="pformleft"><nobr>接收人</nobr></td>
        <td class="pformright" colspan="3" >
            <asp:Label ID="lblReceiver" runat="server" Text=""></asp:Label>
        </td>
      </tr>
      <tr class="pformstrip" width="98%" id="trBtn" runat="server">
        <td colspan="4" align="center">
         <nobr>
           <input type="button" runat="server" id="btnReSend"  class="button" value="重发" onclick="doReSend()"/>
           <input type="button" runat="server" id="btnReply"  class="button" value="回复" onclick="doReply()"/>
           &nbsp;&nbsp;
           <input type="button" runat="server" id="btnForword"  class="button" value="转发" onclick="doForword()"/>
           &nbsp;&nbsp;
           <input type="button" runat="server" id="btnCancle"  class="button" value="关闭" onclick="doCancle()"/>
         </nobr>
        </td>
      </tr>
      
    </table>
   </ccit:ActionForm>
</body>
</html>
